package com.gc.ykqx.service.entity;

import com.gc.ykqx.service.util.Constant;

import java.util.List;

/**
 * Created by wsd on 2017/10/13.
 */

public class Warn {

    /**
     * returnCode : 0
     * returnMessage : Query Succeed
     * rowCount : 8
     * colCount : 2
     * DS : [{"unitname":"璺ˉ姘旇薄灞\u20ac","yjch":"澶ч榛勮壊棰勮"},{"unitname":"鐜夌幆姘旇薄灞\u20ac","yjch":"澶ч榛勮壊棰勮"},{"unitname":"娓╁箔姘旇薄灞\u20ac","yjch":"澶ч榛勮壊棰勮"},{"unitname":"妞掓睙姘旇薄灞\u20ac","yjch":"澶ч榛勮壊棰勮"},{"unitname":"涓存捣姘旇薄灞\u20ac","yjch":"澶ч榛勮壊棰勮"},{"unitname":"涓存捣姘旇薄灞\u20ac","yjch":"澶ч榛勮壊棰勮"},{"unitname":"涓存捣姘旇薄灞\u20ac","yjch":"澶ч榛勮壊棰勮"},{"unitname":"骞抽槼姘旇薄灞\u20ac","yjch":"澶ч榛勮壊棰勮"}]
     */

    private int returnCode;
    private String returnMessage;
    private int rowCount;
    private int colCount;
    private List<DSBean> DS;

    public int getReturnCode() {
        return returnCode;
    }

    public void setReturnCode(int returnCode) {
        this.returnCode = returnCode;
    }

    public String getReturnMessage() {
        return returnMessage;
    }

    public void setReturnMessage(String returnMessage) {
        this.returnMessage = returnMessage;
    }

    public int getRowCount() {
        return rowCount;
    }

    public void setRowCount(int rowCount) {
        this.rowCount = rowCount;
    }

    public int getColCount() {
        return colCount;
    }

    public void setColCount(int colCount) {
        this.colCount = colCount;
    }

    public List<DSBean> getDS() {
        return DS;
    }

    public void setDS(List<DSBean> DS) {
        this.DS = DS;
    }

    public static class DSBean {
        /**
         * unitname : 璺ˉ姘旇薄灞€
         * yjch : 澶ч榛勮壊棰勮
         */

        private String unitname;
        private String yjch;

        public String getUnitname() {
            return unitname;
        }

        public void setUnitname(String unitname) {
            this.unitname = unitname;
        }

        public String getYjch() {
            return yjch;
        }

        public void setYjch(String yjch) {
            this.yjch = yjch;
        }
    }

    @Override
    public String toString() {
        StringBuffer sb = new StringBuffer();
        for (Warn.DSBean ds : DS) {
            if (ds.equals(Constant.YK_UNIT_NAME)) {
                sb.append("预警发布单位:").append(Constant.YK_UNIT_NAME + " ").append("预警内容:").append(ds.yjch + " ").append("\n");
            }
        }
        return sb.toString();
    }
}
